<template>
  <div>
    <div>
      <div class="title_name">
        <div>装修精选</div>
        <div class="recommended_designer_">
          <div @click="changeRecName(index)" :class="{theme_color:getRecUrl === index}"
               v-for="(item,index) in selectName">{{item.title}}
          </div>
        </div>
      </div>
      <div>
        <div class="building_recommend">
          <div>
            <img src="../../assets/image/recommend.png" alt="">
            <div class="build_title">
              <span>热门装修</span>
            </div>
          </div>
          <div>
            <img src="../../assets/image/recommend.png" alt="">
            <div class="build_title">
              <span>优秀设计师</span>
            </div>
          </div>
          <div>
            <img src="../../assets/image/recommend.png" alt="">
            <div class="build_title">
              <span>洋房</span>
            </div>
          </div>
          <div>
            <img src="../../assets/image/recommend.png" alt="">
            <div class="build_title">
              <span>海景公寓</span>
            </div>
          </div>
          <div>
            <img src="../../assets/image/recommend.png" alt="">
            <div class="build_title">
              <span>海景公寓</span>
            </div>
          </div>
          <div>
            <img src="../../assets/image/recommend.png" alt="">
            <div class="build_title">
              <span>海景公寓</span>
            </div>
          </div>
        </div>
      </div>
      <div class="recommended_designer_list">
        <decoration-list></decoration-list>
      </div>
      <div class="building_look_more">
        <div>查看更多</div>
      </div>
    </div>
  </div>
</template>

<script>
  import DecorationList from './DecorationList';

  export default {
    name: 'RecommendedDesigner',
    data() {
      return {
        selectName: [
          {title: '装修公司'},
          {title: '设计师'},
          {title: '施工队'}
        ],
        formData: {
          city_code: 4601,
          page: 1
        },
        listContent: {}
      }
    },
    computed: {
      getRecUrl() {
        return this.$store.getters.getRecUrl;
      }
    },
    methods: {
      changeRecName(index) {
        this.$store.commit('setRecUrl', index);
        this.getRecList();
      },
      getRecList() {

      }
    },
    components: {
      DecorationList
    }

  }
</script>

<style scoped>
  .recommended_designer_ {
    display: flex;
  }

  .recommended_designer_ > div {
    margin: 5px;
    font-size: 0.8rem;
  }

  .title_name {
    display: flex;
    justify-content: space-between;
  }

  .building_recommend {
    display: -webkit-box;
    overflow-x: scroll;
    -webkit-overflow-scrolling: touch;
    padding: 0 10px 10px 0;
  }

  .building_recommend::-webkit-scrollbar {
    display: none;
  }

  .building_recommend > div {
    width: 6rem;
    height: 6rem;
    margin: 0 0 10px 10px;
    position: relative;
  }

  .building_recommend > div:nth-child(1) {
    margin-left: 0;
  }

  .building_recommend > div img {
    width: 100%;
    height: 100%;
  }

  .building_recommend .build_title {
    height: 6rem;
    width: 6rem;
    position: absolute;
    text-align: center;
    top: 0;
    left: 0;
    background-color: rgba(116, 118, 120, 0.2);
    line-height: 6rem;
  }

  .building_recommend .build_title > span {
    text-align: center;
    color: #ffffff;
  }
  .building_look_more {
    height: 3rem;
    margin: 10px 0;
  }

  .building_look_more > div {
    margin: 0 auto;
    height: 3rem;
    width: 10rem;
    line-height: 3rem;
    text-align: center;
    color: #b9b8b8;
    background-color: #f8f8f8;
  }
</style>
